home *** CD-ROM | disk | FTP | other *** search
- Path: news.bridge.net!news
- From: psycho@bridge.net (Gary Thompson)
- Newsgroups: comp.lang.c
- Subject: Re: CONVERTING INTEGER TO ASCII??????
- Date: Fri, 15 Mar 1996 17:31:47 GMT
- Organization: BridgenetLC - 305.374.3031 - 100 S. Biscayne Blvd, Miami
- Message-ID: <4ic9ll$cfp@news.bridge.net>
- References: <4i17r9$2kn@maltese.eag.unisysgsg.com>
- NNTP-Posting-Host: ppp-ftl1-19.bridge.net
- X-Newsreader: Forte Free Agent 1.0.81
-
- ssadra@maltese.eag.unisysgsg.com (Daniel R. Ascheman) wrote:
-
- >HI all,
-
- >I need a way to convert an integer BACK to ascii so I can search for it
- >in a file using the strstr() function in a file. I NEED it as an integer
- >AND as an ascii, is it possible?
- >As you know, strstr() is a char *, char * , so I can't use an int,
- >and itoa() does not exist in UNIX - I am in a slight bind.
-
- >... ... ...
-
- >If no conversion is possible in C/UNIX, anyone have any other ideas?
-
- >I would greatly appreciate comments and possible solutions.
-
- Several ways...
-
- sprintf(buff,"%d",intvalue);
-
- buff=itoa(intvalue,buff,10); (I think...)
-
- Other ways are not so easy...
-
- Gary Thompson
- "The Psycho"
- psycho@bridge.net
- 72607.1365@compuserve.com
- http://www.bridge.net/~psycho
- HTTP://ourworld.compuserve.com/homepages/psychotps
-
-